/*
 * @Descripttion:
 * @Author: chenxt
 * @Date: 2024-03-22 16:35:42
 */
import Cookies from 'js-cookie'
import { TokenKey } from '@/emnus/auth'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token: string) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getSuperMarket() {
  return Cookies.get('supermarketConfig')
}

export function setSuperMarket(str: string) {
  return Cookies.set('supermarketConfig', str, { expires: 365 })
}

export function getStartDate() {
  return Cookies.get('startDate')
}

export function setStartDate(val: string) {
  return Cookies.set('startDate', val, {
    expires: 365
  })
}

export function getZSDate() {
  return Cookies.get('zsstartDate')
}

export function setZSDate(val: string) {
  return Cookies.set('zsstartDate', val, {
    expires: 365
  })
}

export function setYear(val: string) {
  return Cookies.set('dYear', val, {
    expires: 365
  })
}

export function getYear() {
  return Cookies.get('dYear')
}
